package cz.data.common.mark;

import cz.data.common.mark.manage.JdbcManageFactory;
import cz.data.common.mark.manage.MySQLManageDialect;
import cz.data.common.mark.manage.OracleManageDialect;
import cz.data.common.mark.manage.PostgresqlManageDialect;
import cz.data.common.mark.manage.SqlserverManageDialect;
import cz.data.common.support.db.DbType;
import cz.data.common.support.db.manage.DbManageRegistry;
import cz.data.common.support.db.manage.ManageDialectRegistry;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;

@AutoConfigureOrder
public class MarkModuleAutoConfiguration {

    static {
        DbManageRegistry.registry(new JdbcManageFactory(),
                DbType.MARIADB, DbType.MYSQL,
                DbType.ORACLE, DbType.ORACLE_12C,
                DbType.SQL_SERVER, DbType.SQL_SERVER2008,
                DbType.POSTGRE_SQL,
                DbType.VERTICA
        );
        ManageDialectRegistry.registry(new MySQLManageDialect(), DbType.MARIADB, DbType.MYSQL);
        ManageDialectRegistry.registry(new SqlserverManageDialect(), DbType.SQL_SERVER2008, DbType.SQL_SERVER);
        ManageDialectRegistry.registry(new OracleManageDialect(), DbType.ORACLE, DbType.ORACLE_12C);
        ManageDialectRegistry.registry(new PostgresqlManageDialect(), DbType.POSTGRE_SQL);
    }
}
